<?php
session_start();
error_reporting(0);
if($_SESSION['username']!="")
{
?>
<!DOCTYPE html>
<html lang="en">
  <head>
     <? include "./include/head.php"; ?>
	  <? include "./include/js.php"; ?>
  </head>
  <body>
  <? include "./include/body.php"; ?>
        <div class="span9">
        <div class="hero-unit">  
        <?php
        include "./config/connection.php";
        $id_produk = $_GET['id_produk'];
        $perintah="SELECT * FROM produk where id_produk='".$id_produk."'";
	$hasil=mysql_query($perintah);
	$baris=mysql_fetch_array($hasil);
	error_reporting(0); 
	$input = $_GET["input"];
					if($input == "invalid")
					{
						echo"<b>Maaf data kurang lengkap, silahkan ulangi</b>" ;
					}
					
					 
	?>
	 <form class="form-horizontal" action="product_process_edit.php" method="post" enctype="multipart/form-data">
            <fieldset>
             
                <div class="control-group">
                  <label class="control-label">Id Produk</label>
                    <div class="controls">
                        <input type="text" class="input-xlarge"  name="id_produk_x" size="30"  value="<?php echo "$baris[id_produk]";?>" readonly="yes">
						<input type="hidden"  name="id_produk"  value="<?php echo "$baris[id_produk]";?>">
                        <p class="help-block"></p>
                    </div>
                  <label class="control-label">Nama Produk</label>
                    <div class="controls">
                        <input type="text" class="input-xlarge" name="nama_produk" size="30" value="<?php echo "$baris[nama_produk]";?>">
                        <p class="help-block"></p>
                    </div>
                  <label class="control-label">Komposisi</label>
                    <div class="controls">
                        <textarea name="komposisi" class="input-xlarge" rows="9"><?php echo "$baris[komposisi]";?></textarea>
                        <p class="help-block"></p>
                    </div>
                  <label class="control-label">Kemasan</label>
                    <div class="controls">
                        <input type="text" name="kemasan" class="input-xlarge" value="<?php echo "$baris[kemasan]";?>">
                        <p class="help-block"></p>
                    </div>
                  <label class="control-label">Berat</label>
                    <div class="controls">
                        <input type="text" class="input-xlarge" name="berat" size="30" value="<?php echo "$baris[berat]";?>">
                        <p class="help-block"></p>
                    </div>
                  <label class="control-label">Harga</label>
                    <div class="controls">
                        <input type="text" class="input-xlarge" name="harga" size="30" value="<?php echo "$baris[harga]";?>">
                        <p class="help-block"></p>
                    </div>
					<label class="control-label" for="input08">Foto</label>
                    <div class="controls">
                        <?php echo "<img src=foto/foto_produk/$baris[foto]>";?>
						<br/><input type="file" name="foto" size="40">         
                        <p class="help-block"></p>
                    </div>
                </div>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <button class="btn btn-danger" type="submit">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ubah&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </button>
                &nbsp;&nbsp;&nbsp;
                <button class="btn btn-danger" type="reset" value="Reset">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Batal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </button>
            </fieldset>
        </form>
            
            
          </div>
          </div><!--/row-->

         
            </div><!--/span-->
          </div><!--/row-->
        </div><!--/span-->
      </div><!--/row-->

      <hr>

   <? include "./include/menubawah.php"; ?>
    <?php
    
    ?>
  </body>
</html>
<?php
    }
else {
    include 'warning.php';
}
?>